
public class Test {
    public static void main(String[] args) {
//写一个标准的javabean类
//咱们在课后只要能把这个标准的javabean能自己写出来，那么就表示今天的知识点就ok了
//利用空参构造创建对象
        User u1 = new User();
//如果利用空参创建对象，还想赋值只能用set方法赋值
        u1.setUsername("zhangsan");
        u1.setPassword("1234qwer");
        u1.setEmail("itheima@itcast.cn");
        u1.setGender('男');
        u1.setAge(23);
//获取属性的值并打印
        System.out.println(u1.getUsername() + ", " + u1.getPassword()
                + ", " + u1.getEmail() + ", " + u1.getGender() + ", " +
                u1.getAge());
        u1.eat();
        System.out.println("=============================");
//简单的办法
//利用带全部参数的构造来创建对象
//快捷键:ctrl + p
        User u2 = new User("lisi", "12345678", "lisi@itcast.cn", '女', 24);
        System.out.println(u2.getUsername() + ", " + u2.getPassword()
                + ", " + u2.getEmail() + ", " + u2.getGender() + ", " +
                u2.getAge());
        u2.eat();
    }
}